package com.example.week2_intent;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.ImageView;

public class SelectImageActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_select_image);
	}

	
	public void click(View v){
		ImageView iv = (ImageView) v;
		
		Intent data = new Intent();
		switch(v.getId()){
			case R.id.imageView1 :
				data.putExtra("image", R.drawable.qwwe);
				break;
			case R.id.imageView2 :
				data.putExtra("image", R.drawable.rrrrr);
				break;
			case R.id.imageView3 :
				data.putExtra("image", R.drawable.wee);
				break;
		}
		
		setResult(888,data);
		finish();
	}
	
	
	
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_select_image, menu);
		return true;
	}

}
